<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<div class="row">
	<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-right">
		<t-auth:roleButton />
	</div>
</div>
<script type="text/javascript">
function addData(){
	top.openModal("/purchase/returnPurchase/detailed?type="+"add","returnCargo_form","采购退货-添加",1100,550);
}


function returnCargo(){
	var id=getKeyId();
	
	var state =  $(".cntable.table tbody tr.select-tr").attr("data-purchaseState");
	if(state==1){
		$.notify("尚未入库，无可退货物!!","warning");
		return
	}
	if(isEditor(id)){
		top.openModal("/purchase/returnPurchase/detailed?key="+id,"returnCargo_form","采购退货",1100,550);
	}
}


function editData(){
	var id=getKeyId();
	
	if(isEditor(id)){
		top.openModal("/purchase/returnPurchase/seeDetailed?key="+id,"returnCargo_form","采购退货-修改",1100,550);
	}
}

function selData(){
	var key=getKeyId();
	if(isEditor(key)){
		top.openModal("/purchase/returnPurchase/seeDetailed?key="+key+"&type=3","returnCargo_form","采购退货-查看",1100,550);
	
	}
}

function deleteData(){
	 var id=getKeyId();
	 if (isEditor(id)) {
		 var url = $.getVirtualPath()+"/purchase/returnPurchase/delete?key="+id;
		 deleteDataEx(url, searchCallback);
    } 
}

function printer(){
	var key=getKeyId();	
	if(isEditor(key)){
		if(radion(key)){

			top.openModal("/purchase/returnPurchase/outStockDetailPrint?key="+key,"inStock_form","采购退货单打印",1200,450);

			//top.openModal("/purchase/returnPurchase/outStockDetailPrint?key="+key,"outStock_form","采购退货单打印",1100,550);

		}
	}
}

function radion(key){
	if(key.indexOf(",") != -1){
		$.notify("该功能只用于单选!!","warning");
		return false;
	}
	return true;
}

function exportData(){
	var url=$.getVirtualPath()+"/purchase/returnPurchase/exportExcel";
	var data=$("form:first").serialize();
	var cachedId=$.getText(url,data);
	downloadExcel(cachedId);
}
</script>
<%@ include file="/WEB-INF/views/shared/base/scripts/limitless/default/notifications.jsp"%>
